{% extends '::base.html.twig' %} 
{% block title %}Conceptos :: Nuevo{% endblock %}

{% block module_name %}Conceptos{% endblock %}

{% block body %}
<h2>Formulario</h2>
<div class="widget_inside records_list">
    <div class="form">
        <form action="{{ path('conceptos_create') }}" method="post" {{ form_enctype(form) }} id="formID">
            {{ form_widget(form) }}
            <div class="clearfix">
                <label>Formula</label>
                <div class="input">
                    <textarea class="xlarge campoFormula brush: vb" name="formula"></textarea>
                    <a rel="#editorFormulas" data-destination='campoFormula' class="abrirEditor button blue small">Abrir Editor de Formulas</a>
                </div>
            </div>
            <div class="clearfix grey-highlight">
                <div class="input no-label">
                    <button type="submit" class="button blue">Guardar</button>
                    <a href="{{ path('conceptos') }}" class="button">Regresar a la Lista</a>
                </div>
            </div>
        </form>
    </div>
</div>
<div id="editorFormulas" class="overlay">
    {{editorFormulas.content|raw}}
</div>
<script>
    $(document).ready(function(){ 
        $(".agregar").live('click', function(){
            $('a.close').click();
            $("."+$('#editorFormulas').attr('data-destination')).val($('#panel').val());
            return false;
        });
        
        $(".cancelar").live('click', function(){
            $('a.close').click();
            return false;
        });
        
        $('.abrirEditor').overlay({
            mask:{
                color: '#ebecff'
            }
        });
        $('.abrirEditor').click(function(){
            $("#editorFormulas").attr('data-destination', $(this).data("destination"));
            $('#panel').val("");
        });
    });
</script>
{% endblock %}